package com.taobao.txc.parser.b.c;

import com.a.a.a.a.b.b.l;
import com.a.a.a.a.c.c.b;
import com.a.a.a.a.c.c.t;
import com.a.a.a.a.c.c.w;
import com.taobao.txc.common.LoggerInit;
import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.parser.struct.e;
import java.sql.SQLException;
import java.util.List;

public class k
  implements com.taobao.txc.parser.b.a.d
{
  private static final LoggerWrap a = LoggerInit.logger;
  private final com.a.a.a.a.c.a b;
  private final com.taobao.txc.parser.struct.d c;
  private final String d;
  
  public k(String paramString)
  {
    this.d = paramString;
    long l1 = System.currentTimeMillis();
    this.b = com.a.a.a.b.a.a(paramString);
    this.c = e.b(paramString);
    long l2 = System.currentTimeMillis();
    if (l2 - l1 > 10L) {
      a.info(String.format("SQL:[%s] parser too slow, cost [%d] ms.", new Object[] { paramString, Long.valueOf(l2 - l1) }));
    }
  }
  
  public com.a.a.a.a.c.a e()
  {
    return this.b;
  }
  
  public com.taobao.txc.parser.struct.d d()
  {
    return this.c;
  }
  
  public String a()
  {
    return this.d;
  }
  
  public String b()
  {
    com.a.a.a.a.c.a locala = e();
    return a(locala);
  }
  
  public String c()
  {
    String str = null;
    if ((!(this.b instanceof b)) && (!(this.b instanceof com.a.a.a.a.c.c.d)))
    {
      Object localObject;
      com.a.a.a.a.b.b.n localn;
      if ((this.b instanceof com.a.a.a.a.c.c.n))
      {
        localObject = (com.a.a.a.a.c.c.n)this.b;
        localn = ((com.a.a.a.a.c.c.n)localObject).f();
        str = b(localn);
      }
      else if ((this.b instanceof w))
      {
        localObject = (w)this.b;
        localn = ((w)localObject).c();
        str = b(localn);
      }
    }
    return str;
  }
  
  private String a(com.a.a.a.a.c.a parama)
  {
    String str = null;
    Object localObject1;
    Object localObject2;
    if ((parama instanceof b))
    {
      localObject1 = (b)parama;
      localObject2 = (com.a.a.a.a.a.f.d)((b)localObject1).a().get(0);
      str = a((com.a.a.a.a.a.f.d)localObject2);
    }
    else if ((parama instanceof com.a.a.a.a.c.c.d))
    {
      localObject1 = (com.a.a.a.a.c.c.d)parama;
      localObject2 = ((com.a.a.a.a.c.c.d)localObject1).a();
      str = a((com.a.a.a.a.a.f.d)localObject2);
    }
    else if ((parama instanceof com.a.a.a.a.c.c.n))
    {
      localObject1 = (com.a.a.a.a.c.c.n)parama;
      localObject2 = ((com.a.a.a.a.c.c.n)localObject1).f();
      str = a((com.a.a.a.a.b.b.n)localObject2);
    }
    else if ((parama instanceof w))
    {
      localObject1 = (w)parama;
      localObject2 = ((w)localObject1).c();
      str = a((com.a.a.a.a.b.b.n)localObject2);
    }
    else if ((parama instanceof t))
    {
      localObject1 = (t)parama;
      localObject2 = ((t)localObject1).c();
      str = a((com.a.a.a.a.c.a)((List)localObject2).get(0));
    }
    if (str == null)
    {
      localObject1 = String.format("getTableName error, %s", new Object[] { parama.getClass().getName() });
      a.error((String)localObject1, (String)localObject1);
      throw new SQLException((String)localObject1);
    }
    return str;
  }
  
  private String a(com.a.a.a.a.b.b.n paramn)
  {
    if (!paramn.b()) {
      throw new SQLException("getTableName error, unsupported complex sql.");
    }
    return ((l)paramn.d().get(0)).d().f();
  }
  
  private String b(com.a.a.a.a.b.b.n paramn)
  {
    if (!paramn.b()) {
      throw new SQLException("getTableName error, unsupported complex sql.");
    }
    return ((l)paramn.d().get(0)).a();
  }
  
  private String a(com.a.a.a.a.a.f.d paramd)
  {
    String str = "";
    com.a.a.a.a.a.f.d locald = paramd.c();
    if (locald != null)
    {
      str = a(locald);
      str = str + ".";
    }
    return str + paramd.e().toUpperCase();
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.parser.b.c.k
 * JD-Core Version:    0.7.0.1
 */